package cn.stylefeng.guns.sys.modular.system.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.entity.ZxBx;
import cn.stylefeng.guns.sys.modular.system.entity.ZxChengben;
import cn.stylefeng.guns.sys.modular.system.model.params.ZxBxParam;
import cn.stylefeng.guns.sys.modular.system.model.params.ZxChengbenParam;
import cn.stylefeng.guns.sys.modular.system.model.result.MdzxResult;
import cn.stylefeng.guns.sys.modular.system.model.result.ZxChengbenResult;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * bty_zx_demo 服务类
 * </p>
 *
 * @author liuy
 * @since 2020-11-02
 */
public interface ZxBxService extends IService<ZxBx> {

    /**
     * 新增
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    ZxChengbenResult add(ZxBxParam param);

    /**
     * 删除
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    void delete(ZxBxParam param);

    /**
     * 更新
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    void update(ZxChengbenParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    ZxChengbenResult findBySpec(ZxChengbenParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    List<ZxChengbenResult> findListBySpec(ZxChengbenParam param);

    /**
     * 查询分页数据，Specification模式
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    LayuiPageInfo findPageBySpec(ZxChengbenParam param);

    LayuiPageInfo findPageShenhe(ZxChengbenParam param);

    LayuiPageInfo findChengbenAndMingXiPageBySpec(ZxChengbenParam param);

    ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response, ZxChengbenParam param);

    /**
     * 成本信息导入
     *
     * @param fileName
     * @param file
     * @return
     */
    ResponseData batchImport(String fileName, MultipartFile file) throws Exception;

    /**
     * 成本信息导入
     *
     * @param fileName
     * @param file
     * @return
     */
    ResponseData batchImportBaoXiaoDan(String fileName, MultipartFile file) throws Exception;

    ResponseData dakuan_queren(ZxChengbenParam zxChengbenParam);
    ResponseData dakuan_quxiao(ZxChengbenParam zxChengbenParam);

    @Transactional(rollbackFor = Exception.class)
    ResponseData importTz(String fileName, MultipartFile file) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    ResponseData btnImportTzBatch() throws Exception;

    MdzxResult queryMdMohu(String name);

    ResponseData kemuCorrection();

    void updateForMingxi(Long btyZxChengbenId);

    public ZxBx getEntity(ZxBxParam param);

    ResponseData audit(ZxBxParam param);

    void chehui(Long btyZxChengbenId) throws Exception;
}
